load("//tools:defaults.bzl", "extract_api_to_json", "ng_project", "ng_web_test_suite")

package(default_visibility = ["//visibility:public"])

ng_project(
    name = "tree",
    srcs = [
        "index.ts",
        "tree.ts",
    ],
    deps = [
        "//:node_modules/@angular/core",
        "//src/aria/combobox",
        "//src/aria/private",
        "//src/cdk/a11y",
        "//src/cdk/bidi",
    ],
)

ng_project(
    name = "unit_test_sources",
    testonly = True,
    srcs = [
        "tree.spec.ts",
    ],
    deps = [
        ":tree",
        "//:node_modules/@angular/common",
        "//:node_modules/@angular/core",
        "//:node_modules/@angular/platform-browser",
        "//src/cdk/testing/private",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [":unit_test_sources"],
)

filegroup(
    name = "source-files",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
)

extract_api_to_json(
    name = "json_api",
    srcs = [
        ":source-files",
    ],
    entry_point = ":index.ts",
    module_name = "@angular/aria/tree",
    output_name = "aria-tree.json",
    private_modules = [""],
    repo = "angular/components",
)
